#include<stdio.h>
#include<sys/types.h>
#include <unistd.h>

int main()
{
   pid_t id=fork();
   if(id==0)
   {
       int count =5;
       while(count)
       {
           printf("我是子进程Pid:%d\n",getpid());
            sleep(1);
           count--;
       }
   }else
   {
        while(1)
        {
           printf("我是父进程我正在运行\n");
            sleep(1);
        }
   }
    //printf("我是一个进程Pid:%d\n",getpid());
    //int x;
    //scanf("%d",&x);
    //while(1)
    //{
    //    printf("i am process..PID:%d\n",getpid());
    //}    
    return 0;
}
